This project draws inspiration from my PhD research, which partly focuses on studying the dynamical system associated with a special class of non-linear quantum protocols. The time evolution induced by such a protocol can be mathematically described using an iterated function system. Determining the outcome of the protocol involves calculating the attractive points and their corresponding attraction regions within the dynamical systems. For pure initial states, the border of these attraction basins forms the Julia set, which may exhibit a highly intricate structure—a fractal embedded in a two-dimensional space. Conversely, in the case of arbitrary initial states, the set of boundary points, termed the quasi-Julia set, represents a fractal embedded within a three-dimensional space. The primary objective of this project is to conduct a comprehensive numerical analysis of both the Julia set and the quasi-Julia set across a diverse range of protocols within the aforementioned family. Through examining their fractal properties, I aim to elucidate the underlying dynamics and gain deeper insights into the behavior of these systems. Specifically, I aim to determine the multifractal spectra of these sets using the box-counting method and interpret the outcomes. The behavior of the generalized dimension can reveal the potential scaling rules of fractals, thereby discerning whether the studied sets are truly multifractals or monofractals.
As part of the project, I have so far implemented numerical methods for calculating the Julia set and the quasi-Julia set. Furthermore, I have implemented multiple algorithms that can be used to estimate the fractal dimension of these sets, both in the 2- and 3-dimensional case (the box-counting and correlation dimension). Based on the box-counting algorithm and the method introduced in Ref. [1], I also implemented a method for determining a multifractal spectrum of the 2D and 3D fractal sets. The results of these numerical calculations are shown below.
Further tasks to be completed in the next weeks:
The time evolution of the quantum system can be described with an iterated system of the following map:
$ U = \frac{(1 - p^2)(u + iv)^3 + (1 - \overline{p}^2)(u -iv)^3 - 2(p + \overline{p})w(w^2+3)}{2 \left(3 w^{2} + 1\right) \left(1 + \left|{p}\right|^{2}\right)} $
$ V = i \frac{(1 + \overline{p}^2)(u - iv)^3 - (1 + p^2)(u+iv)^3 + 2(p - \overline{p})w(w^2 + 3)}{2 \left(3 w^{2} + 1\right) \left(1 + \left|{p}\right|^{2}\right)} $
$ W = \frac{p \left(u + i v\right)^{3} + \overline{p} \left(u - i v\right)^{3} + w(w^2 + 3)(1 - |p|^2)}{\left(3 w^{2} + 1\right) \left(1 + \left|{p}\right|^{2}\right)} $
We use this map to numerically calculate the convergence of different states, i.e. the trajectories starting from a point of the Riemann sphere. Therefore the Fractal set, as the border of the convergence regions, can be determined.
The box-counting dimension is a measure of the fractal dimension, which quantifies the space-filling properties of an object, or a set. There are well-known methods for estimating this quantity. Those methods usually involve covering the set with a grid of squares (or cubes in 3D), called boxes, of different sizes, counting the number of grid cells that intersect elements of the set for each size. Then, by analyzing how the number of required boxes changes with the change in scale, the fractal dimension of the set can be estimated.
First, one covers the set with a grid of boxes of a certain size over the set and counts the number of grid cells that intersect with the object. This count represents how many boxes are needed to cover the object at the given size. Then, repeat the process with smaller grid cells, covering the object at finer resolutions. Fitting a straight line to the data pairs of the logarithm of the reciprocal of the grid size (box size), and the logarithm of the number of boxes needed to cover the set, the box-counting dimension can be determined as the slope of the curve.
The correlation dimension is another method used to quantify the fractal dimension of a set. It is based on how points in the data set are correlated with each other as a function of the distance between them.
The first step in calculating the correlation dimension is to compute the correlation integral ( C(r) ):
$$ C(r) = \frac{2}{N(N-1)} \sum_{i=1}^{N} \sum_{j=i+1}^{N} \Theta(r - ( \mathbf{x}_i - \mathbf{x}_j () $$where ( N ) is the total number of points in the data set, ( \mathbf{x}_i ) and ( \mathbf{x}_j ) are points in the data set, ( ( \cdot ( ) denotes the Euclidean distance between points, and ( \Theta(\cdot) ) is the Heaviside step function. From this, the correlation dimension ( D_2 ) is estimated by analyzing the scaling behaviour of ( C(r) ) by plotting the logarithm of ( C(r) ) versus the logarithm of ( r ). The slope of the curve fitted to the data points provides an estimate of the correlation dimension.
The multifractal spectrum characterizes the self-similarity and heterogeneity of a set by revealing how the fractal dimensions vary at different scales. It is typically represented as a set of different measures of the system. This spectrum can be calculated using the box-counting method. To calculate it, first partition the system into boxes of different sizes, as in the standard box-counting method. Then, for each box size, the box count dimension is calculated, which represents the fractal dimension of the system part covered by the box. Next, by analyzing how the box count dimension changes with the size of the boxes, we examine the scaling behaviour of the box count dimensions at different scales. This usually involves fitting a curve to the data points and analyzing its shape and characteristics.
A detailed method is presented in Ref. [1].
[1] A. Chhabra and R. V. Jensen, ‘Direct determination of the f(α) singularity spectrum’, Phys. Rev. Lett., vol. 62, no. 12, pp. 1327–1330, Mar. 1989, doi: 10.1103/PhysRevLett.62.1327.
[2] T. Vicsek, Fractal Growth Phenomena, 2nd ed. WORLD SCIENTIFIC, 1992. doi: 10.1142/1407.
[3] ‘Multifractal Spectrum - an overview | ScienceDirect Topics’. Accessed: Apr. 10, 2024. [Online]. Available: https://www.sciencedirect.com/topics/mathematics/multifractal-spectrum
[4] ‘What are Multifractals?’ Accessed: Apr. 10, 2024. [Online]. Available: https://imagej.net/ij/plugins/fraclac/FLHelp/Multifractals.htm#distribution
[5] ‘Multifractal system’, Wikipedia. Mar. 04, 2024. Accessed: Apr. 10, 2024. [Online]. Available: https://en.wikipedia.org/w/index.php?title=Multifractal_system&oldid=1211767822#f(%CE%B1)_versus_%CE%B1
import numpy as np
import matplotlib.pyplot as plt
# import functions from FractalPorject.py
import source.FractalProject as FP
# list all defined function, description in the source file
for i in dir(FP):
print(i)
FS_2D FS_3D FS_backiteration MAP __builtins__ __cached__ __doc__ __file__ __loader__ __name__ __package__ __spec__ _round box_counter box_counter_3D box_counting_dimension_2D box_counting_dimension_3D box_number_2D box_number_3D box_number_back_iteration calculate_distance_matrix calculate_multifractal_spectra_3D calculate_multifractal_spectrum_2D calculate_of_repelling_fixed_points calculate_the_attractive_cycles correlation_dimension_2D correlation_dimension_3D correlation_integral gridspec inverse_iteration inverse_stereographic_projection jit norm np nth_root numerical_multiplier operator plot_multifractal_spectrum_2D plot_multifractal_spectrum_3D plt purity random_points_in_ball random_points_on_sphere stats unique
pi,di=1,2
_ = FP.box_counting_dimension_2D(np.arange(2,50,2),10,pi,di,1, plot=True, i = 3, j=-3, number_of_iteration=10)
_ = FP.box_counting_dimension_2D(np.arange(2,50,2),10,pi,di,1, plot=True, i = 3, j=-3,method="backiteration")
_ = FP.box_counting_dimension_3D(np.arange(5,85,5),500,pi,di, number_of_iteration=10, plot=True, i=0, j=-3)
_ = FP.correlation_dimension_2D(pi,di,np.linspace(0.5,1,101), plot=True)
_ = FP.correlation_dimension_3D(pi,di,np.linspace(0.5,1,51),plot=True,num_points=50, num_iteration=1000, i=3)
fractal = FP.FS_2D(50,pi,di,1)
result = FP.calculate_multifractal_spectrum_2D(fractal,np.arange(10,200,2),np.linspace(-10,10,51))
FP.plot_multifractal_spectrum_2D(result,di,pi)
fractal_3D,_,_,_ = FP.FS_3D(20, 1000, pi, di)
R = FP.calculate_multifractal_spectra_3D(fractal_3D,np.arange(4,200,10),np.linspace(-10,10,51))
FP.plot_multifractal_spectrum_3D(R, di, pi)
C:\Users\attil\Workspace\FractalProject\source\FractalProject.py:651: RuntimeWarning: divide by zero encountered in log result = stats.linregress(np.log(s[i:j]), np.log(bn[i:j])) C:\Users\attil\anaconda3\lib\site-packages\numpy\lib\function_base.py:2487: RuntimeWarning: invalid value encountered in subtract X -= avg[:, None] C:\Users\attil\Workspace\FractalProject\source\FractalProject.py:656: RuntimeWarning: divide by zero encountered in log ax1.plot(np.log(s[i:j]), np.log(bn[i:j]),'r.--')
Box-counting Dimension: nan +/- nan
C:\Users\attil\Workspace\FractalProject\source\FractalProject.py:651: RuntimeWarning: divide by zero encountered in log result = stats.linregress(np.log(s[i:j]), np.log(bn[i:j])) C:\Users\attil\anaconda3\lib\site-packages\numpy\lib\function_base.py:2487: RuntimeWarning: invalid value encountered in subtract X -= avg[:, None] C:\Users\attil\Workspace\FractalProject\source\FractalProject.py:656: RuntimeWarning: divide by zero encountered in log ax1.plot(np.log(s[i:j]), np.log(bn[i:j]),'r.--')
Box-counting Dimension: nan +/- nan
C:\Users\attil\Workspace\FractalProject\source\FractalProject.py:725: RuntimeWarning: divide by zero encountered in log result = stats.linregress(np.log(s[i:j]), np.log(bn[i:j])) C:\Users\attil\anaconda3\lib\site-packages\numpy\lib\function_base.py:2487: RuntimeWarning: invalid value encountered in subtract X -= avg[:, None] C:\Users\attil\Workspace\FractalProject\source\FractalProject.py:738: RuntimeWarning: divide by zero encountered in log ax.plot(np.log(s[i:j]), np.log(bn[i:j]),'r.--')
Box-counting Dimension: nan +/- nan
Correlation Dimension: -1.588 +/- 0.001
C:\Users\attil\Workspace\FractalProject\source\FractalProject.py:918: RuntimeWarning: invalid value encountered in true_divide C_r = correlations / len(points)
Correlation Dimension: nan +/- nan
C:\Users\attil\Workspace\FractalProject\source\FractalProject.py:983: RuntimeWarning: invalid value encountered in double_scalars alpha_qe[box_sizei, qi] = np.sum(P**q*np.log(P))/np.sum(P**q) C:\Users\attil\Workspace\FractalProject\source\FractalProject.py:994: RuntimeWarning: divide by zero encountered in log results = stats.linregress(np.log(box_sizes), np.log(I_qe[:,qi])) C:\Users\attil\anaconda3\lib\site-packages\numpy\lib\function_base.py:2487: RuntimeWarning: invalid value encountered in subtract X -= avg[:, None] C:\Users\attil\Workspace\FractalProject\source\FractalProject.py:997: RuntimeWarning: divide by zero encountered in log results = stats.linregress(-np.log(box_sizes), np.log(I_qe[:,qi]))
C:\Users\attil\Workspace\FractalProject\source\FractalProject.py:1054: RuntimeWarning: invalid value encountered in double_scalars alpha_qe[box_sizei, qi] = np.sum(P**q*np.log(P))/np.sum(P**q) C:\Users\attil\Workspace\FractalProject\source\FractalProject.py:1065: RuntimeWarning: divide by zero encountered in log results = stats.linregress(np.log(box_sizes), np.log(I_qe[:,qi])) C:\Users\attil\anaconda3\lib\site-packages\numpy\lib\function_base.py:2487: RuntimeWarning: invalid value encountered in subtract X -= avg[:, None] C:\Users\attil\Workspace\FractalProject\source\FractalProject.py:1068: RuntimeWarning: divide by zero encountered in log results = stats.linregress(-np.log(box_sizes), np.log(I_qe[:,qi]))
p = np.array([1,1.5,2]) # parameter values
deg = np.array([2,3,4]) # degree values
for pi in p:
for di in deg:
_ = FP.box_counting_dimension_2D(np.arange(2,50,2),1000,pi,di,1, plot=True, i = 3, j=-3, number_of_iteration=100)
Box-counting Dimension: 1.543 +/- 0.009
Box-counting Dimension: 1.528 +/- 0.005
Box-counting Dimension: 1.514 +/- 0.007
Box-counting Dimension: 1.592 +/- 0.006
Box-counting Dimension: 1.7 +/- 0.007
Box-counting Dimension: 1.432 +/- 0.011
Box-counting Dimension: 1.302 +/- 0.013
Box-counting Dimension: 1.879 +/- 0.007
Box-counting Dimension: 1.159 +/- 0.015
p = np.array([1,1.5,2]) # parameter values
deg = np.array([2,3,4]) # degree values
for pi in p:
for di in deg:
_ = FP.box_counting_dimension_2D(np.arange(2,50,2),1000,pi,di,1, plot=True, i = 3, j=-3,method="backiteration")
Box-counting Dimension: 1.574 +/- 0.008
Box-counting Dimension: 1.539 +/- 0.004
Box-counting Dimension: 1.532 +/- 0.006
Box-counting Dimension: 1.63 +/- 0.007
Box-counting Dimension: 1.387 +/- 0.007
Box-counting Dimension: 1.462 +/- 0.008
Box-counting Dimension: 1.354 +/- 0.011
Box-counting Dimension: 1.2 +/- 0.012
Box-counting Dimension: 1.223 +/- 0.023
p = np.array([1,1.5,2]) # parameter values
deg = np.array([2,3,4]) # degree values
for pi in p:
for di in deg:
_ = FP.box_counting_dimension_3D(np.arange(5,85,5),500000,pi,di, number_of_iteration=100, plot=True, i=0, j=-3)
Box-counting Dimension: 2.731 +/- 0.025
Box-counting Dimension: 2.75 +/- 0.02
Box-counting Dimension: 2.691 +/- 0.035
Box-counting Dimension: 2.73 +/- 0.025
Box-counting Dimension: 2.758 +/- 0.018
Box-counting Dimension: 2.707 +/- 0.033
Box-counting Dimension: 2.707 +/- 0.033
Box-counting Dimension: 2.766 +/- 0.017
Box-counting Dimension: 2.707 +/- 0.032
p = np.array([1,1.5,2]) # parameter values
deg = np.array([2,3,4]) # degree values
for pi in p:
for di in deg:
_ = FP.correlation_dimension_2D(pi,di,np.linspace(0.5,1,101), plot=True)
Correlation Dimension: -1.548 +/- 0.002
Correlation Dimension: -1.548 +/- 0.015
Correlation Dimension: -1.736 +/- 0.011
Correlation Dimension: -1.372 +/- 0.003
Correlation Dimension: -1.387 +/- 0.012
Correlation Dimension: -1.609 +/- 0.011
Correlation Dimension: -1.256 +/- 0.002
Correlation Dimension: -1.146 +/- 0.01
Correlation Dimension: -1.458 +/- 0.011
p = np.array([1,1.5,2]) # parameter values
deg = np.array([2,3,4]) # degree values
for pi in p:
for di in deg:
_ = FP.correlation_dimension_3D(pi,di,np.linspace(0.5,1,51),plot=True,num_points=500, num_iteration=1000000, i=3)
Correlation Dimension: 1.993 +/- 0.009
Correlation Dimension: 2.035 +/- 0.011
Correlation Dimension: 2.055 +/- 0.019
Correlation Dimension: 2.097 +/- 0.009
Correlation Dimension: 2.083 +/- 0.003
Correlation Dimension: 2.056 +/- 0.027
Correlation Dimension: 2.573 +/- 0.028
Correlation Dimension: 2.195 +/- 0.004
Correlation Dimension: 1.179 +/- 0.046
p = np.array([1,1.5,2]) # parameter values
deg = np.array([2,3,4]) # degree values
for pi in p:
for di in deg:
fractal = FP.FS_2D(500,pi,di,1)
result = FP.calculate_multifractal_spectrum_2D(fractal,np.arange(10,200,2),np.linspace(-10,10,51))
FP.plot_multifractal_spectrum_2D(result,di,pi)
p = np.array([1,1.5,2]) # parameter values
deg = np.array([2,3,4]) # degree values
for pi in p:
for di in deg:
fractal_3D,_,_,_ = FP.FS_3D(200, 1000000, pi, di)
R = FP.calculate_multifractal_spectra_3D(fractal_3D,np.arange(4,200,10),np.linspace(-10,10,51))
FP.plot_multifractal_spectrum_3D(R, di, pi)